Integrand size = 41, antiderivative size = 115 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx=\frac {(i A (2-n)+B (2+n)) \operatorname {Hypergeometric2F1}\left (2,n,1+n,\frac {1}{2} (1-i \tan (e+f x))\right ) (c-i c \tan (e+f x))^n}{16 a^2 f n}+\frac {(i A-B) (c-i c \tan (e+f x))^n}{4 a^2 f (1+i \tan (e+f x))^2} \]
[Out]
Time = 0.20 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 79, 70} \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx=\frac {(B (n+2)+i A (2-n)) (c-i c \tan (e+f x))^n \operatorname {Hypergeometric2F1}\left (2,n,n+1,\frac {1}{2} (1-i \tan (e+f x))\right )}{16 a^2 f n}+\frac {(-B+i A) (c-i c \tan (e+f x))^n}{4 a^2 f (1+i \tan (e+f x))^2} \]
[In]
[Out]
Rule 70
Rule 79
Rule 3669
Rubi steps \begin{align*} \text {integral}& = \frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)^{-1+n}}{(a+i a x)^3} \, dx,x,\tan (e+f x)\right )}{f} \\ & = \frac {(i A-B) (c-i c \tan (e+f x))^n}{4 a^2 f (1+i \tan (e+f x))^2}+\frac {(c (A (2-n)-i B (2+n))) \text {Subst}\left (\int \frac {(c-i c x)^{-1+n}}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{4 f} \\ & = \frac {(i A (2-n)+B (2+n)) \operatorname {Hypergeometric2F1}\left (2,n,1+n,\frac {1}{2} (1-i \tan (e+f x))\right ) (c-i c \tan (e+f x))^n}{16 a^2 f n}+\frac {(i A-B) (c-i c \tan (e+f x))^n}{4 a^2 f (1+i \tan (e+f x))^2} \\ \end{align*}
Time = 2.48 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.32 \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx=\frac {(c-i c \tan (e+f x))^n \left (-i A (-3+n)+B (1+n)+\frac {i (-1+n) (A (-2+n)+i B (2+n)) \operatorname {Hypergeometric2F1}\left (1,n,1+n,-\frac {1}{2} i (i+\tan (e+f x))\right )}{n}+(-i A (-3+n)+B (1+n)) (\cos (2 (e+f x))-i \sin (2 (e+f x)))-\frac {2 (A+i B) (i+\tan (e+f x))}{(-i+\tan (e+f x))^2}\right )}{16 a^2 f} \]
[In]
[Out]
\[\int \frac {\left (A +B \tan \left (f x +e \right )\right ) \left (c -i c \tan \left (f x +e \right )\right )^{n}}{\left (a +i a \tan \left (f x +e \right )\right )^{2}}d x\]
[In]
[Out]
\[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx=\int { \frac {{\left (B \tan \left (f x + e\right ) + A\right )} {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n}}{{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{2}} \,d x } \]
[In]
[Out]
\[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx=- \frac {\int \frac {A \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{\tan ^{2}{\left (e + f x \right )} - 2 i \tan {\left (e + f x \right )} - 1}\, dx + \int \frac {B \left (- i c \tan {\left (e + f x \right )} + c\right )^{n} \tan {\left (e + f x \right )}}{\tan ^{2}{\left (e + f x \right )} - 2 i \tan {\left (e + f x \right )} - 1}\, dx}{a^{2}} \]
[In]
[Out]
Exception generated. \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx=\text {Exception raised: RuntimeError} \]
[In]
[Out]
\[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx=\int { \frac {{\left (B \tan \left (f x + e\right ) + A\right )} {\left (-i \, c \tan \left (f x + e\right ) + c\right )}^{n}}{{\left (i \, a \tan \left (f x + e\right ) + a\right )}^{2}} \,d x } \]
[In]
[Out]
Timed out. \[ \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^n}{(a+i a \tan (e+f x))^2} \, dx=\int \frac {\left (A+B\,\mathrm {tan}\left (e+f\,x\right )\right )\,{\left (c-c\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^n}{{\left (a+a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^2} \,d x \]
[In]
[Out]